1. Field of the Invention
The present invention relates to a correction method and a correction device for correcting an optical distortion upon digital image data, and a photographing device with such correction device.
2. Description of the Related Art
According to a photographing device such as a silver salt camera or a digital camera, a subject image is photographed through an optical lens and an image representing the subject image is obtained. In such photographing device, the periphery of the obtained image is distorted because of refraction of the lens. This distortion is generally referred to as an optical distortion. The lens used for the photographing device is structured so as to eliminate such optical distortion.
In the case that the lens is a zoom lens, however, it is difficult to correct a tele end and a wide end by the same lens structure. For this reason, large optical distortion easily occurs. In the case of a single vision lens, in order to perform correction, a lens must be made of expensive materials or a number of lens structures must be increased. Thus, a lens structure which is thin and inexpensive is difficult to be realized. In the case of the thin and inexpensive lens structure, an optical distortion remains.
In the case that an obtained image is recorded in a film as in the case of a silver salt camera, an image cannot be corrected once recorded. For this reason, an optical distortion is determined depending on the performance of a lens. On the other hand, when an image is obtained as digital data and recorded in a recording media as in the case of a digital camera, an image can be corrected by a calculation processing even after being recorded. Techniques for correcting an optical distortion have been conventionally suggested in the field of digital camera.
An optical distortion is classified into two types, i.e., “a spool type” in which corner portions of an image extend to the outside as shown in FIG. 1A and “a barrel type” in which the corner portions are shrunk as shown in FIG. 1B. It is generally known that a distortion amount (a displacement amount) is determined by the distance from an optical center in both of the aforementioned types. If the displacement amount is linear, an image is simply enlarged/reduced. In actuality, however, the displacement amount draws a non-linear curve as shown in FIG. 1C. In the case of positive displacement amount, the “spool type” can be obtained because pixels are shifted from their original positions in a direction away from the optical center. In the case of negative displacement amount, the “barrel type” can be obtained because the pixels are placed so as to approach the optical center from their original positions.
Japanese Patent Application Laid-Open (JP-A) Nos. 6-292207 and 10-271490 describe a technique for correcting such optical distortions. According to this technique, a correction amount is calculated from coordinates on an image, and the correction amount is stored as a table in a memory, so that correction is performed. According to the technique, however, the memory for storing the table for the correction amount requires a storage capacity corresponding to the size of image data. For this reason, as the image size is increased, the storage capacity required for this memory is also increased. As a result, a work area in the memory is reduced and a price of the memory is increased.
A technique for solving such drawbacks is described in JP-A No. 11-252431. According to this technique, a correction amount is represented by an approximate expression and then corrected. Namely, it is generally known that a displacement amount of optical distortion as shown in FIG. 1C can be approximately represented by a polynominal expression. An inverse number of this polynominal expression is used as a correction expression. In this technique, correction amounts for the respective coordinates need not held in a table. Only parameters (coefficients for the polynominal expression) are stored in a memory and thus all of the coordinates of a uncorrected image can correspond to the coordinates of a corrected image by calculation. Generally, pixel data of a required coordinate is appropriately read from a memory storing a uncorrected image and pixel data of a corrected image is generated. It takes a long time for a CPU to get an access to the memory and perform a correction processing even for a processing upon only one pixel. Therefore, much longer time is required to process the entire image.
As described in JP-A No. 2001-101396, data which is necessary for correction is DMA transferred from a memory storing a uncorrected image and the transferred data is stored in an internal memory. As a result, a speed can be increased.
According to this technique, however, DMA transfer information, a correction coefficient and the coordinate of uncorrected data must be produced in advance for correction. Further, such information must be DMA transferred. As a result, there arises a problem in that a large capacity of memory is required.
The displacement amount of an optical distortion increases as being away from an optical center. For this reason, the number of lines of pixel data of a uncorrected image required to generate corrected pixels of one line may vary depending on the position that the correction is performed. Thus, an addressing for DMA transfer must be set for each of lines. As a result, there arises a problem in that processings become complicated.